package phapp.model.luckstar;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;

/**
 * Title: t_staruse_data 数据类 POJO Description: DAO层映射到数据类,页面封装数据映射到数据类
 * Copyright: Copyright (c) 2012-10 Company:
 * 
 * @author you name
 * @version 1.0
 */

public class Staruse extends BaseEntity
{
   public static final int USE_TYPE_PRAY = 1;
   public static final int USE_TYPE_OIL = 2;

   // date formats
   public static final String FORMAT_USE_DATE = DATE_TIME_FORMAT;

   // columns START
   /** dataId */
   private java.lang.Integer dataId;
   /** custId */
   private java.lang.Integer custId;
   /** receiverId */
   private java.lang.Integer receiverId;
   /** useType */
   private java.lang.Integer useType;
   /** useCount */
   private java.lang.Integer useCount;
   /** objectId */
   private java.lang.Integer objectId;
   /** useDate */
   private java.sql.Timestamp useDate;
   /** useNote */
   private java.lang.String useNote;

   private java.util.ArrayList idList;

   // columns END

   public Staruse()
   {
   }

   public Staruse(java.lang.Integer dataId)
   {
      this.dataId = dataId;
   }

   public void setId(java.lang.Integer value)
   {
      this.dataId = value;
   }

   public java.lang.Integer getId()
   {
      return this.dataId;
   }
   
   public void setDataId(java.lang.Integer value)
   {
      this.dataId = value;
   }

   public java.lang.Integer getDataId()
   {
      return this.dataId;
   }

   public void setCustId(java.lang.Integer value)
   {
      this.custId = value;
   }

   public java.lang.Integer getCustId()
   {
      return this.custId;
   }

   public void setReceiverId(java.lang.Integer value)
   {
      this.receiverId = value;
   }

   public java.lang.Integer getReceiverId()
   {
      return this.receiverId;
   }

   public void setUseType(java.lang.Integer value)
   {
      this.useType = value;
   }

   public java.lang.Integer getUseType()
   {
      return this.useType;
   }

   public void setUseCount(java.lang.Integer value)
   {
      this.useCount = value;
   }

   public java.lang.Integer getUseCount()
   {
      return this.useCount;
   }

   public void setObjectId(java.lang.Integer value)
   {
      this.objectId = value;
   }

   public java.lang.Integer getObjectId()
   {
      return this.objectId;
   }

   public String getUseDateString()
   {
      return date2String(getUseDate(), FORMAT_USE_DATE);
   }

   public void setUseDateString(String value)
   {
      setUseDate(string2Date(value, FORMAT_USE_DATE, java.sql.Timestamp.class));
   }

   public void setUseDate(java.sql.Timestamp value)
   {
      this.useDate = value;
   }

   public java.sql.Timestamp getUseDate()
   {
      return this.useDate;
   }

   public void setUseNote(java.lang.String value)
   {
      this.useNote = value;
   }

   public java.lang.String getUseNote()
   {
      return this.useNote;
   }

   public java.util.ArrayList getIdList()
   {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList)
   {
      this.idList = idList;
   }

   /** 手动增加属性后,toString,hashCode,equals都要修改 */
   public String toString()
   {
      return new ToStringBuilder(this).append("DataId", getDataId()).append("CustId", getCustId()).append("receiverId", getReceiverId()).append("UseType", getUseType()).append("UseCount", getUseCount()).append("ObjectId", getObjectId())
               .append("UseDate", getUseDate()).append("UseNote", getUseNote()).toString();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(getDataId()).append(getCustId()).append(getReceiverId()).append(getUseType()).append(getUseCount()).append(getObjectId()).append(getUseDate()).append(getUseNote()).toHashCode();
   }

   public boolean equals(Object obj)
   {
      if (obj instanceof Staruse == false) return false;
      if (this == obj) return true;
      Staruse other = (Staruse) obj;
      return new EqualsBuilder().append(getDataId(), other.getDataId()).append(getCustId(), other.getCustId()).append(getReceiverId(), other.getReceiverId()).append(getUseType(), other.getUseType()).append(getUseCount(), other.getUseCount())
               .append(getObjectId(), other.getObjectId()).append(getUseDate(), other.getUseDate()).append(getUseNote(), other.getUseNote()).isEquals();
   }
}
